home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI334.ASC
< prev
next >
Wrap
Text File
|
1992-08-12
|
4KB
|
133 lines
PRODUCT : Paradox NUMBER : 334
VERSION : 1.0 & up
OS : DOS
DATE : August 12, 1992 PAGE : 1/2
TITLE : Paradox Table Growth
Paradox stores records in fixed blocks of 1K, 2K, 3K or 4K. To
calculate record size, use the following figures:
Numeric and dollar fields 8 bytes per record each field
Date fields 4 bytes per record each field
Short integer fields 2 bytes per record each field
Alphanumeric 1 byte per character per record
per each field
Paradox automatically selects what it considers the optimum block
size for a table when it is created. For unkeyed tables, Paradox
allocates the smallest block size that can contain a single
record. For keyed tables, Paradox allocates the smallest block
size that can contain three records. This is why the maximum
record size for a Paradox record drops from 4096 bytes for
unkeyed tables to 1350 bytes for keyed tables. (1350 * 3 fits
into a 4096 block).
For example, if a record in an unkeyed table is 100 bytes in
size, then Paradox allocates 1K block size of 1K (1024 bytes).
Paradox always uses 6 bytes for the block pointer. This leaves
1018 bytes (1024 - 6) in the block. Therefore, 10 records
(10*100=1000) will fit into each block, with 2 percent unused
space. In another example, if a record's size is 1400 bytes,
then Paradox allocates block sizes of 2K. Since only one record
(1400 bytes) can fit into a 2K block (2048 bytes), 31 percent of
the block is unused.
If the table is keyed and the record size is 500 bytes, Paradox
allocates a block size of 2K. This is the smallest block that
fits three records (500*3+6=1506.) Therefore, 6 records
(6*500+12=3012 bytes) fit into 2 blocks (2 * 2048 = 4096 bytes)
with 26.5 percent unused space.
To calculate the amount of unused space in a block, take the
difference between the block size (1024, 2048, 3072, or 4096) and
the number of bytes that fit into the block e.g. (2048 - (3*500)
= 548). To calculate the percentage of block space used, take
the number of bytes that fit into the block and divide it by the
block size ((3*500)/2048 = .73).
During an edit session, Paradox reserves blocks for new records
and changes to existing records. Therefore, growth occurs
PRODUCT : Paradox NUMBER : 334
VERSION : 1.0 & up
OS : DOS
DATE : August 12, 1992 PAGE : 2/2
TITLE : Paradox Table Growth
whenever a change is made or new records are added. Deletion of
one or more records does not automatically reclaim the blocks
that were reserved during the course of the session.
Compressing Tables:
Tables can be made to assume their optimal size with the
following methods:
- Use Modify/Data Entry instead of edit to add records to a
table.
- Compress the table with Modify | Restructure and press
<F2> "Do_It!" without making any changes. This reclaims
any space used by deleted records.
- Normalize the table (see "Tips for Creating Tables" in the
Create section of the Paradox User's Manual or consult
Technical Information Sheets 124 and 127 for further
information).
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.